﻿using System;

namespace Fadd.IO.Consoles
{
    /// <summary>
    /// Used to send console stuff to a remote end point
    /// </summary>
    public interface IConsoleChannel : IStartable
    {
        /// <summary>
        /// Send output to remote party
        /// </summary>
        /// <param name="output">Output from the console.</param>
        void Send(ConsoleOutput output);

        /// <summary>
        /// Send a command enter in the console
        /// </summary>
        /// <param name="command">Command and it's arguments</param>
        /// <remarks>
        /// Commands are typically read from StandardIn in console windows.
        /// </remarks>
        void Send(Command command);

        /// <summary>
        /// A command was received from the other end.
        /// </summary>
        event EventHandler<CommandEventArgs> CommandReceived;

        /// <summary>
        /// Something has been written into the console.
        /// </summary>
        event EventHandler<OutputEventArgs> OutputReceived;
    }
}